﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Model;
using Controller;

namespace Facade
{
    public class SubBranchFacade
    {
        public string Save(SubBranch SubBranchs)
        {
            SubBranchController cont = new SubBranchController();
            return cont.Save(SubBranchs);
        }

        public string Delete(SubBranch SubBranchs)
        {
            SubBranchController cont = new SubBranchController();
            return cont.Delete(SubBranchs);
        }

        public IList<SubBranch> GetAll(string sSearch, int PageNumber, int DataLength, string SortCol, string SortDirection, out int TotalData, int BusinessGroupID)
        {
            IList<SubBranch> SubBranchs = new List<SubBranch>();
            SubBranchController cont = new SubBranchController();
            SubBranchs = cont.GetAll(sSearch, PageNumber, DataLength, SortCol, SortDirection, out TotalData, BusinessGroupID);
            return SubBranchs;
        }

        public IList<SubBranch> GetAllSubBranchesByLocationID(string sSearch, int LocationID, int PageNumber, int DataLength, string SortCol, string SortDirection, out int TotalData)
        {
            IList<SubBranch> SubBranchs = new List<SubBranch>();
            SubBranchController cont = new SubBranchController();
            SubBranchs = cont.GetAllSubBranchesByLocationID(sSearch, LocationID, PageNumber, DataLength, SortCol, SortDirection, out TotalData);
            return SubBranchs;
        }

        public SubBranch GetSubBranchByID(int ID)
        {
            SubBranch SubBranchs = new SubBranch();
            SubBranchController cont = new SubBranchController();
            SubBranchs = cont.GetSubBranchByID(ID);
            return SubBranchs;
        }

        public SubBranch GetSubBranchByCode(string Code)
        {
            SubBranch SubBranchs = new SubBranch();
            SubBranchController cont = new SubBranchController();
            SubBranchs = cont.GetSubBranchByCode(Code);
            return SubBranchs;
        }

        public SubBranch GetSubBranchByDescription(string Description)
        {
            SubBranch SubBranchs = new SubBranch();
            SubBranchController cont = new SubBranchController();
            SubBranchs = cont.GetSubBranchByDescription(Description);
            return SubBranchs;
        }
    }
}